package io.jpress.admin.controller;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by xucheng on 2017/5/30.
 */
public enum  HallEnum {

    HALL0("0", "未来馆"),
    HALL1("1", "商业馆"),
    HALL2("2", "安全可靠馆"),
    HALL3("3", "综合馆"),
    HALL4("4", "智能制造馆"),
    HALL5("5", "红色柱状图");

    private String key;
    private String value = "";

    HallEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static String getValue(int key) {
        for (HallEnum ps : HallEnum.values()) {
            if (ps.getKey().equals(String.valueOf(key))) {
                return ps.getValue();
            }
        }
        return null;
    }


    public static Map<String, String> getHallMap() {
        HallEnum[] values = HallEnum.values();
        Map<String, String> map = new LinkedHashMap<>();
        for (HallEnum type : values) {
            map.put(type.getKey(), type.getValue());
        }
        return map;
    }


    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
